import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

//1导入组件
import Main from '@/views/Main.vue'
import Login from '@/views/Login/Login.vue'
import Register from '@/views/Login/Register.vue'
import ArtCate from '@/views/Article/ArtCate.vue'
import ArtList from '@/views/Article/ArtList.vue'
import Home from '@/views/Home/Home.vue'
import UserAvatar from '@/views/User/UserAvatar.vue'
import UserInfo from '@/views/User/UserInfo.vue'
import UserPwd from '@/views/User/UserPwd.vue'

//2路由规则
const routes = [
{path:'/',redirect:'/main'},
{path:'/main',component:Main},
{path:'/login',component:Login},
{path:'/register',component:Register},
{path:'/art-cate',component:ArtCate},
{path:'/art-list',component:ArtList},
{path:'/home',component:Home},
{path:'/user-avatar',component:UserAvatar},
{path:'/user-info',component:UserInfo},
{path:'/user-pwd',component:UserPwd},
]

const router = new VueRouter({
  routes
})

export default router
